home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 983 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  1.4 KB

  1. Path: pwolf-mac.qualcomm.com!user
  2. From: pwolf@qualcomm.com (Paul I. Wolf )
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: problem with inline
  5. Date: 8 Jan 1996 19:31:34 GMT
  6. Organization: Qualcomm, Inc.
  7. Message-ID: <pwolf-0801961131340001@pwolf-mac.qualcomm.com>
  8. References: <821123790snz@jprassoc.demon.co.uk>
  9. NNTP-Posting-Host: pwolf-mac.qualcomm.com
  10.  
  11. In article <821123790snz@jprassoc.demon.co.uk>, Paul@jprassoc.demon.co.uk wrote:
  12.  
  13. > Can someone help me out here ?
  14. > I'm getting an error message from the linker when I declare one of my
  15. > functions as inline.
  16. > The compiler is MSVC 1.52
  17. > The error message is:
  18. > MAIN.OBJ(c:\temp\main.cpp) : error L2029:
  19. > 'public: void __far __pascal vga::blt_screen(void)__far' : unresolved external
  20. > Here's a snippet of code:
  21. > MAIN.CPP:
  22. > #include "vga.h"
  23. > // ...
  24. >     VGA.wait_for_vsync();
  25. >     VGA.blt_screen();
  26. > // ...
  27. > VGA.H:
  28. > class vga
  29. > {
  30. > public:
  31. > // ...
  32. >         void wait_for_vsync(void);
  33. >         void blt_screen(void);
  34. > private:
  35. >         unsigned char far *video_buffer;
  36. >         unsigned char far *double_buffer;
  37. > };
  38. > VGA.CPP:
  39. > // ...
  40. > inline void vga::blt_screen(void)
  41. > {
  42. >         _fmemcpy( video_buffer, double_buffer, 64000 );
  43. > }
  44. > // ...
  45. > Thanks in advance,
  46. > -- 
  47. > Paul Robertson
  48.  
  49.  
  50. Declare it inline in vga.h - the compiler needs to find the first
  51. declaration saying inline in order to generate inline code instead of a
  52. call to an external function.
  53.